home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Explorer Yardimcilari / PiXCL Tools / Comms2.px_ / Comms2.px
Encoding:
PiXCL source  |  1996-08-12  |  2.0 KB  |  92 lines

  1. Initialize:
  2.     WinGetActive(Win$)
  3.     UseCoordinates(PIXEL)
  4.     UseBackGround(TRANSPARENT,192,192,192)
  5.     DrawBackGround
  6.     WaitInput(100)  {let NT and 95 catch up}
  7.     InfoMenu(REMOVE)
  8.     SetMenu()
  9.     WinLocate(Win$,250,10,620,240,Res) 
  10.     Title$ = "Message Passing App #2"
  11.     WinTitle(Win$, Title$)
  12.     {WinShow(Title$,NOTOPMOST,Res)}
  13.     DirGet(SourceDir$)
  14.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  15.  
  16.     SetMenu("E&xit!",Leave,
  17.         ENDPOPUP,
  18.         "&Mode",IGNORE,
  19.         "&Transmit",Transmit,
  20.         "&Receive",Receive,
  21.         "&Loop",CommLoop,
  22.         ENDPOPUP,
  23.         "&Help",IGNORE,
  24.         "&Concept",Concept,
  25.         "&View Source",ViewSource,
  26.         "&About",About,
  27.         ENDPOPUP)
  28.  
  29.         Loop = 0
  30.         
  31. Wait_for_Input:
  32.     WaitInput()
  33.  
  34. { NOTE: if a PXLResume message is received while the 
  35.   program is pausing at the above WaitInput(), it will
  36.   proceed directly to the next command, and then exit. }
  37.  
  38. Leave:
  39.     End
  40.  
  41. CommLoop:
  42.     Loop = 1
  43.  
  44.     Goto Wait_for_Input
  45.  
  46. Transmit:
  47.     SetMouse(cx1,cy1,cx2,cy2,Process,X,Y)
  48.     If Loop = 0 Then Goto Wait_for_Input
  49.  
  50. Receive:
  51.     WaitInput()
  52.     DrawBackGround
  53.     DrawIcon(10,10,64,64,ICON02)
  54.     If Loop = 0 Then Goto Wait_for_Input
  55.  
  56.  
  57. Process:
  58.     PXLResume("Message Passing App #1",Res)
  59.     If Res = 0 Then MessageBox(OK,1,INFORMATION,"Msg Failed","Message Passing App #1",Res)
  60.     If Loop = 1 Then Goto Receive
  61.     Goto Wait_for_Input
  62.  
  63.  
  64. Concept:
  65.     MessageBox(OK,1,INFORMATION,
  66. "This sample program demonstrates how two PiXCL
  67. applications can communicate with each other by
  68. passing a 'resume' message after a WaitInput()
  69. command has been issued.
  70.  
  71. You can select transmit or receive ONE message at a time,
  72. or select LOOP, then receive or transmit, and the two
  73. programs will alternate sending 'resume' messages to
  74. each other.",
  75.     "Message Passing",Res)
  76.     Goto Wait_for_Input
  77.  
  78. ViewSource:
  79.     PXLFile$ = SourceDir$ + "\comms2.pxl"
  80.     CmdLine$ = "NotePad " + PXLFile$
  81.     Run(CmdLine$)
  82.     Goto Wait_for_Input
  83.  
  84.  
  85. About:
  86.     AboutUser("Message Passing with PiXCL 4.0",
  87. "WaitInput() and PXLResume commands.", 
  88. "A PXL application can wait for another application to tell it to continue.")
  89.     Goto Wait_for_Input
  90.  
  91.  
  92.